import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export const list = (data) => {
    return request({
            url: baseUrl + '/start/sysRole/page',
            method: 'get',
            data: data
        }
    )
}
export const add = (data) => {
    return request({
            url: baseUrl + '/start/sysRole/add',
            method: 'post',
            data: data
        }
    )
}
export const updateById = (id,data,index) => {
    return request({
            url: baseUrl + '/start/sysRole/updateById',
            method: 'put',
            data: data
        }
    )
}
export const deleteById = (id) => {
    return request({
            url: baseUrl + '/start/sysRole/deleteById/' + id,
            method: 'delete',
        }
    )
}
export const getCurrentUserMenu = () => {
    return request({
            url: baseUrl + '/start/sysRole/getCurrentUserMenu',
            method: 'get',
        }
    )
}

export const getRoleMenu = (roleId) => {
    return request({
            url: baseUrl + '/start/sysRole/getRoleMenu/' + roleId,
            method: 'get',
        }
    )
}
export const saveRoleMenu = (data) => {
    return request({
            url: baseUrl + '/start/sysRole/saveRoleMenu',
            method: 'post',
            data: data,
        }
    )
}
const roleApi={
    list,
}
export default roleApi
